package com.smsc.headend.task.engine.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.smsc.headend.module.data.entity.DataItemGroup;
import com.smsc.headend.module.data.entity.ScheduleReadingEntity;
import com.smsc.headend.module.data.entity.SubDataItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author Tangzj
 * @date 2020/9/30 16:39
 */
@Repository
public interface ScheduleReadingMapper extends BaseMapper<ScheduleReadingEntity> {

//    @ResultType(ScheduleReadingEntity.class)
//    @Select({"select * from (select t.*,m.customer_sn,m.mfg_sn,m.model_id from rd_meter_reads_lp t inner join m_meter m on m.meter_id = t.meter_id ${ew.customSqlSegment})"
//    ," pivot(max(value) for data_item_id in(${params.pivotItemStr}))"
//    ," order by customer_sn,tv desc"})
//    List<ScheduleReadingEntity> queryList(@Param("page") IPage<ScheduleReadingEntity> page, @Param("params") Map<String, Object> params,@Param(Constants.WRAPPER) QueryWrapper<ScheduleReadingEntity> queryWrapper);
}
